<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        for (var i = 1; i <= 100; i++) {
            console.log('演示文本');
        }

        for (var i = 0; i <= 100; i++) {
            console.log('他今年' + i + '岁了');
        }

        for (var i = 1; i <= 100; i++) {
            if (i == 1) {
                console.log('一岁出生');
            } else if (i == 100) {
                console.log('100岁嗝屁');
            } else {
                console.log('今年' + i + '岁');
            }
        }

        //1-100整数和
        var sum = 0;
        for (var i = 1; i <= 100; i++) {
            sum += i;
        };
        console.log(sum);

        //求1-100之间左右偶数和奇数和
        var ouShu = 0;
        var jiShu = 0;
        for (var i = 1; i <= 100; i++) {
            // if (i % 2 == 0) {
            //     ouShu += i
            // } else {
            //     jiShu += i
            // }
            i % 2 == 0 ? ouShu += i : jiShu += i
        }
        console.log(ouShu);
        console.log(jiShu);

        //求1-100之间所有能被3整除的数字和
        var sum3 = 0;
        for (var i = 1; i <= 100; i++) {
            // if (i % 3 == 0) {
            //     sum3 += i
            // }
            i % 3 == 0 ? sum3 += i : sum
        }
        console.log(sum3);
    </script>
</head>

<body>

</body>

</html>